public class code {
    public static void main(String[] args) {
        int a = 18 ;
        int b = 48 ;
        while(b % a >0)
        {
            int c = b % a;
            b = a;
            a = c;
        }
        System.out.println(a);
    }
}
